Skip to content

feat: add workflow init command and bump version#19

Merged
atrtde merged 4 commits intomainfrom
feat/workflow-init
Mar 17, 2026
Merged

feat: add workflow init command and bump version#19
atrtde merged 4 commits intomainfrom
feat/workflow-init

Conversation

@atrtde
Copy link
Copy Markdown
Owner

@atrtde atrtde commented Mar 17, 2026

No description provided.

@atrtde atrtde self-assigned this Mar 17, 2026
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Mar 17, 2026

TODO Summary

Showing TODOs in changed files only

Found 5 TODO(s) in 1 file(s):

Summary by tag
Tag Count
TODO 2
FIXME 2
BUG 1
Details by file

``

  • 🟡 TODO (L176): This will be found ✓
  • 🔴 FIXME (L177): This will be found ✓
  • 🔴 BUG (L178): This will be found ✓
  • 🟡 TODO (L187): Assigned to john ✓
  • 🔴 FIXME (L188): Needs team review ✓

Last updated: 2026-03-17T18:46:50.215Z

@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps Bot commented Mar 17, 2026

Greptile Summary

This PR introduces a tt workflow init command (v0.5.0) that scaffolds a .github/workflows/todo-tree.yml GitHub Actions workflow file, bumps both the todo-tree and todo-tree-core crates to 0.5.0, and adds matching documentation and changelog entries.

Key changes:

  • New workflow subcommand in cli/src/commands/workflow.rs with --force, --path, and --action flags, directory auto-creation, and an owner/repo@ref format validator.
  • CLI wiring in cli.rs, lib.rs, and commands/mod.rs to register and dispatch the new subcommand.
  • Version bump across cli/Cargo.toml, core/Cargo.toml, and Cargo.lock from 0.4.20.5.0.
  • Docs & changelog updated in README.md and CHANGELOG.md.

Issues found:

  • The validate_action_ref function does not reject whitespace characters (spaces, tabs) or a double-@ in the reference segment, meaning inputs like "owner/repo @v1" or "owner/repo@@v1" silently pass validation and generate a broken uses: line in the emitted YAML.
  • The new ## GitHub Actions section in README.md is inserted inside the ## Terminal Support section, which causes the ### Clickable Links subsection to be re-parented under ## GitHub Actions in all Markdown renderers.

Confidence Score: 3/5

  • Safe to merge after fixing the whitespace/double-@ validation gap in validate_action_ref, as the bug silently generates broken workflow files for edge-case inputs.
  • The core feature is well-structured — validation, directory creation, and error handling are all present. The version bump is consistent across all crates. However, validate_action_ref has a meaningful gap: space, tab, and double-@ inputs pass validation and emit invalid YAML uses: lines, which would silently produce broken workflow files for users who supply such values. The README section placement issue is cosmetic but incorrect. These lower confidence from an otherwise clean PR.
  • cli/src/commands/workflow.rs — the validate_action_ref function needs the whitespace and double-@ checks. README.md — the ## GitHub Actions section placement needs to be moved outside the ## Terminal Support section.

Important Files Changed

Filename Overview
cli/src/commands/workflow.rs New workflow init command; contains a validation gap where whitespace characters in an action reference bypass checks and generate broken YAML, and actions/checkout@v6 is hardcoded in the template (previously flagged).
cli/src/cli.rs Adds WorkflowArgs, WorkflowCommands, and WorkflowInitArgs structs with --force, --path, and --action flags; no issues found.
cli/Cargo.toml Bumps todo-tree to 0.5.0 and updates the todo-tree-core dependency version to match; consistent with the rest of the version bump.
README.md Documents tt workflow init and its flags; the new ## GitHub Actions section is misplaced within the ## Terminal Support section, causing ### Clickable Links to be re-parented in Markdown rendering.
CHANGELOG.md Adds todo-tree-0.5.0 changelog entry documenting the new workflow init command; accurate and consistent with the code changes.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A([tt workflow init]) --> B{action flag provided?}
    B -->|yes| C[validate_action_ref]
    B -->|no| D[use default action ref]
    D --> C
    C -->|invalid| E([Error: bad format])
    C -->|valid| F{path flag provided?}
    F -->|yes| G[use custom path]
    F -->|no| H[use default workflow path]
    G --> I{file exists and not force?}
    H --> I
    I -->|yes| J([Error: use --force to overwrite])
    I -->|no| K[create parent directories]
    K --> L[write workflow YAML template]
    L --> M([Print success message])
Loading

Last reviewed commit: 1ef65c6

Comment thread cli/src/commands/workflow.rs
Comment thread cli/src/commands/workflow.rs Outdated
Comment thread cli/src/commands/workflow.rs
atrtde and others added 2 commits March 17, 2026 14:32
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
@atrtde
Copy link
Copy Markdown
Owner Author

atrtde commented Mar 17, 2026

@greptileai

Comment thread cli/src/commands/workflow.rs
@atrtde atrtde merged commit 701d3ac into main Mar 17, 2026
11 checks passed
@atrtde atrtde deleted the feat/workflow-init branch March 17, 2026 18:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant